package sg.edu.nus.iss.vmcs.util;

import sg.edu.nus.iss.vmcs.entity.Coin;
import sg.edu.nus.iss.vmcs.ui.CustomerPanel;

/**
 * This will act as the target coin validator.
 * @author user
 *
 */
public class CoinValidator {
	private Coin coin;
	
	public CoinValidator(Coin coin) {
		this.coin = coin;
	}
	
	public boolean validateCoin() {
		if ((int)coin.getWeight() == 0) {
			return false;
		} else {
			Coin actualCoin = CustomerPanel.getCoins().get(coin.getId());
			return coin.getWeight() == actualCoin.getWeight();
		}
	}
}
